package org.zfes.snowier.cloud.zbss.metting.router.service.user;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.metting.biz.model.MettingsNotifyReader;
import org.zfes.snowier.cloud.zbss.metting.biz.service.IMettingsNotifyReaderService;
@Controller 
@RequestMapping("/auth/mettingsNotifyReader")
public class MettingsNotifyReaderController extends BaseController {

	
	@Autowired
	private IMettingsNotifyReaderService mettingsNotifyReaderService;
	
    @RequestMapping(value="/loadMettingsNotifyReaderDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadMettingsNotifyReaderDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  mettingsNotifyReaderService.loadMettingsNotifyReaderDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
    @RequestMapping(value="/createMettingsNotifyReader", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createMettingsNotifyReader(MettingsNotifyReader mettingsNotifyReader){
		mettingsNotifyReaderService.createMettingsNotifyReader(mettingsNotifyReader);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/loadMettingsNotifyReader", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadMettingsNotifyReader(Long id){
		Optional<MettingsNotifyReader> ops = mettingsNotifyReaderService.loadMettingsNotifyReaderById(id);
		return ajaxQuery("mettingsNotifyReader",ops);
    }
	
    @RequestMapping(value="/updateMettingsNotifyReader", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateMettingsNotifyReader(MettingsNotifyReader mettingsNotifyReader){
		mettingsNotifyReaderService.updateMettingsNotifyReader(mettingsNotifyReader);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/deleteMettingsNotifyReader", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteMettingsNotifyReader(Long id){
		mettingsNotifyReaderService.deleteMettingsNotifyReader(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}